import { Component } from 'react';
import emitter from "./events";

class TwoList extends Component {
    handleClick = (message) => {
        //  发布事件，也就是触发事件
        emitter.emit('changeMessage', message);
    };
    render() {
        return (
            <div>
                <button onClick={this.handleClick.bind(this, 'TwoList')}>点击我改变OneList组件中显示信息</button>
            </div>
        );
    }
}
export default TwoList;